package com.cssnj.portal;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.WebApplicationInitializer;


@SpringBootApplication
@ComponentScan({"io.predictech.framework", "com.cssnj.portal"})
@EnableTransactionManagement(proxyTargetClass = true)
@EnableScheduling
@EnableCaching
@ServletComponentScan({"io.predictech.framework"})
@EntityScan({"io.predictech.framework", "com.cssnj.portal"})
@EnableJpaRepositories({"io.predictech.framework", "com.cssnj.portal"})
public class DataPortalApplication extends SpringBootServletInitializer implements WebApplicationInitializer {
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(DataPortalApplication.class);
    }


    public static void main(String[] args) {

        SpringApplication.run(DataPortalApplication.class, args);
    }
}
